Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vmware_vm_info: Add allocated Storage, CPU and Memory to output #1283

Merged

Conversation

Nina2244
Copy link
Contributor

@Nina2244 Nina2244 commented Apr 7, 2022

SUMMARY

Add allocated Storage, CPU and Memory to output

ISSUE TYPE

Feature Pull Request

COMPONENT NAME

vmware_vm_info.py

ADDITIONAL INFORMATION

@Nina2244 Nina2244 changed the title Add allocated Storage, CPU and Memory to output vmware_vm_info: Add allocated Storage, CPU and Memory to output Apr 7, 2022
Copy link
Collaborator

@mariolenz mariolenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERROR: Found 2 pep8 issue(s) which need to be resolved:

PyVmomi, get_all_objs,
vmware_argument_spec, _get_vm_prop,
get_parent_datacenter, find_vm_by_name)
from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, get_all_objs, vmware_argument_spec, _get_vm_prop, get_parent_datacenter, find_vm_by_name
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERROR: plugins/modules/vmware_vm_info.py:246:161: E501: line too long (174 > 160 characters)

"storage": storage_allocated,
"cpu": vm.config.hardware.numCPU,
"memory": vm.config.hardware.memoryMB
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERROR: plugins/modules/vmware_vm_info.py:340:17: E123: closing bracket does not match indentation of opening bracket's line

if isinstance(device, vim.vm.device.VirtualDisk):
storage_allocated += device.capacityInBytes

allocated = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a flag to return these facts optionally (for example - show_allocated ) rather than always returning facts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I will do this.

Nina2244 added 3 commits May 9, 2022 16:04
Add a posibility to show or not to show the allocation.
@mariolenz
Copy link
Collaborator

recheck

@softwarefactory-project-zuul
Copy link

@mariolenz
Copy link
Collaborator

recheck

@softwarefactory-project-zuul
Copy link

@softwarefactory-project-zuul
Copy link

@mariolenz
Copy link
Collaborator

recheck

@softwarefactory-project-zuul
Copy link

@mariolenz
Copy link
Collaborator

recheck

@softwarefactory-project-zuul
Copy link

Copy link
Collaborator

@mariolenz mariolenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@softwarefactory-project-zuul
Copy link

Build succeeded (gate pipeline).

✔️ ansible-tox-linters SUCCESS in 3m 52s
✔️ build-ansible-collection SUCCESS in 4m 13s
✔️ ansible-test-sanity-docker-devel SUCCESS in 9m 25s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 8m 42s
✔️ ansible-test-sanity-docker-stable-2.11 SUCCESS in 10m 06s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 10m 12s
✔️ ansible-test-units-community-vmware-python27 SUCCESS in 5m 37s
✔️ ansible-test-units-community-vmware-python36 SUCCESS in 5m 46s
✔️ ansible-test-units-community-vmware-python37 SUCCESS in 4m 35s
✔️ ansible-test-units-community-vmware-python38 SUCCESS in 5m 11s
✔️ ansible-galaxy-importer SUCCESS in 4m 01s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants